﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using com.huigo.Framework.ServiceUtils;

namespace com.huigo.B2B.Web
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public string BindData(string type)
        {
            string content = string.Empty;
            List<RequestFuncParams> list = new List<RequestFuncParams>();
            list.Add(new RequestFuncParams("type", type));
            BaseService service = new BaseService();
            ParserXml parser = service.RequestEntryService(Dict.ERequestFunc.GET_PRODUCT_LIST_INDEX, list);
            if (parser != null && parser.RowsCount > 0)
            {
                string productName = string.Empty;
                for (int i = 0; i < parser.RowsCount; i++)
                {
                    if (parser["ProductName", i].Length > 12)
                    {
                        productName = parser["ProductName", i].Substring(0, 12) + "...";
                    }
                    else
                    {
                        productName = parser["ProductName", i];
                    }
                    content += "<table><tr><td><img src=\"/img/logo/" + parser["CompanyLogo", i] + "\" /><a href=\"ProductDetail.aspx?id=" + parser["ProductId", i] + "\" style=\"font-size:14px;font-weight:bolder;\" target=\"_blank\" title=\"" + parser["ProductName", i] + "\">" + productName + "</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"ProductDetail.aspx?id=" + parser["ProductId", i] + "\" target=\"_blank\">详细信息>></a></td></tr></table>";
                }
            }
            return content;
        }
    }
}
